home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1996 July
/
C-C++ Users Group Library July 1996.iso
/
listings
/
v_10_12
/
cstream.h
< prev
next >
Wrap
C/C++ Source or Header
|
1992-07-24
|
742b
|
35 lines
Listing 1
// CSTREAM.H
#ifndef _CSTREAM_H
#define _CSTREAM_H
#include <iostream.h>
#include <conio.h>
class ConioBuffer: public streambuf {
public:
ConioBuffer () { unbuffered(1); }
virtual ~ConioBuffer () {}
virtual int overflow (int ch) {
if(ch=='\n')
{ clreol(); putch('\r'); }
putch(ch);
if(ch=='\n')
clreol();
return ch;
}
};
class ConioStream : public ostream {
ConioBuffer *buf;
public:
ConioStream() : ostream() { buf=new ConioBuffer(); ios::init(buf); }
virtual ~ConleStream () { if(buf) delete buf; }
} ;
#endif //_CSTREAM_H